/*==========================================================================
 *
 *  Copyright (C) 1995 Microsoft Corporation. All Rights Reserved.
 *
 *  File:       ddutil2.h
 *  Content:    Routines for loading bitmap and palettes from resources
 *  Notes:		This version of DD utilities is for DirectDraw 2.0 or higher
 *
 ***************************************************************************/

#ifdef __cplusplus
extern "C" {            /* Assume C declarations for C++ */
#endif  /* __cplusplus */

extern IDirectDrawPalette * DDLoadPalette(IDirectDraw2 *pdd, LPCSTR szBitmap);
extern IDirectDrawSurface2 * DDLoadBitmap(IDirectDraw2 *pdd, LPCSTR szBitmap, int dx, int dy, BOOL bInVideo);
extern HRESULT              DDReLoadBitmap(IDirectDrawSurface2 *pdds, LPCSTR szBitmap);
extern HRESULT              DDCopyBitmap(IDirectDrawSurface2 *pdds, HBITMAP hbm, int x, int y, int dx, int dy);
extern DWORD                DDColorMatch(IDirectDrawSurface2 *pdds, COLORREF rgb);
extern HRESULT              DDSetColorKey(IDirectDrawSurface2 *pdds, COLORREF rgb);

// added by Tian Yue
// read palette by customed palette file
// load palette from .pal file
extern void  TY_LoadPaletteFromPAL(const char * szBitmap,PALETTEENTRY * pal,int num);
// load palette from .bmp file
extern void TY_LoadPaletteFromBMP(LPCTSTR szBitmap,PALETTEENTRY *pal,int num);

#ifdef __cplusplus
}
#endif  /* __cplusplus */
